#ifndef USERMANAGEMENT_H
#define USERMANAGEMENT_H

#include "touchbutton.h"
#include <QWidget>
#include <QVBoxLayout>
#include <QHBoxLayout>
#include <QLabel>
#include <QPushButton>
#include <QListView>
#include <QStandardItemModel>
#include <QApplication>
#include <QMouseEvent>
class UserManagement : public QWidget
{
    Q_OBJECT

public:
    explicit UserManagement(QWidget *parent = nullptr);

private:
    void initUI();
    void setupListView();
    void addUserToModel(int permission,QString strUserName,int row = -1);
    void updateUserInModel(int permission,QString strUserName,int row);
    void removeUserFromModel(int row);
    int getCurrentRow() const;

private slots:
    void onAddButtonClicked();
    void onEditButtonClicked();
    void onDeleteButtonClicked();

private:
    QListView *listView;
    QStandardItemModel *model;
    TouchButton *addButton;
    QWidget *headerWidget;
};

#endif // USERMANAGEMENT_H
